/**
 * 
 */
package bancosys.tec.services.implementor.descriptor;

import jmine.tec.di.resolver.ObjectResolver;
import jmine.tec.di.scope.TypedScope;
import jmine.tec.di.type.TypeConvertionException;
import jmine.tec.di.wrapper.Wrapper;
import jmine.tec.services.api.RawInput;
import jmine.tec.services.api.ServiceProperties;

/**
 * ObjectResolver para {@link RawInput}
 * 
 * @author takeshi
 */
final class RawInputResolver implements ObjectResolver {

    /**
     * {@inheritDoc}
     */
    public boolean isResolvable(TypedScope properties) {
        return true;
    }

    /**
     * {@inheritDoc}
     */
    public boolean isStatic() {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    public Object resolveObject(TypedScope properties, Wrapper wrapper, Class<?> requiredComponentClass)
            throws TypeConvertionException {
        return (ServiceProperties) properties;
    }

    /**
     * {@inheritDoc}
     */
    public boolean isTypeCompatible(Class<?> declaredRawType) {
        return declaredRawType.isAssignableFrom(RawInput.class);
    }
}